package com.vote.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * The persistent class for the house database table.
 * 
 */
@Entity
@Table(name = "PRIZE_RECORD")
public class PrizeRecord implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6887555909555885161L;
	private Long id;
	private String ip;
	private String cookie;	
	private Long prizeLevel;
	private String prizeName;
	private String remark;
	private Long status;	
	private Date createTime;	
	private Date updateTime;		
	private Long verion;
		
	private PrizeSetting prizeSetting;
	private PrizeInfo prizeInfo;
	private Respondent respondent;
		
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	public Long getId() {
		return id;
	}	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "CREATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "UPDATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "STATUS")
	public Long getStatus() {
		return status;
	}

	public void setStatus(Long status) {
		this.status = status;
	}	
	
	@Column(name = "IP")
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	@Column(name = "COOKIE")
	public String getCookie() {
		return cookie;
	}
	public void setCookie(String cookie) {
		this.cookie = cookie;
	}

	@Column(name = "PRIZE_LEVEL")
	public Long getPrizeLevel() {
		return prizeLevel;
	}
	public void setPrizeLevel(Long prizeLevel) {
		this.prizeLevel = prizeLevel;
	}
	@Column(name = "PRIZE_NAME")
	public String getPrizeName() {
		return prizeName;
	}
	public void setPrizeName(String prizeName) {
		this.prizeName = prizeName;
	}
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
		
	@ManyToOne
	@JoinColumn(name = "SETTING_ID")
	public PrizeSetting getPrizeSetting() {
		return prizeSetting;
	}
	public void setPrizeSetting(PrizeSetting prizeSetting) {
		this.prizeSetting = prizeSetting;
	}
	
	@ManyToOne
	@JoinColumn(name = "RESP_ID")
	public Respondent getRespondent() {
		return respondent;
	}
	public void setRespondent(Respondent respondent) {
		this.respondent = respondent;
	}
	
	@Version
	@Column(name = "VERSION")
	public Long getVerion() {
		return verion;
	}
	public void setVerion(Long verion) {
		this.verion = verion;
	}
	
	@ManyToOne
	@JoinColumn(name = "PINFO_ID")
	public PrizeInfo getPrizeInfo() {
		return prizeInfo;
	}
	public void setPrizeInfo(PrizeInfo prizeInfo) {
		this.prizeInfo = prizeInfo;
	}
	
}